<?php
require_once '../sub/init.php';
require_once 'chkUadm.php';
if(!in_array('about',$QXARR))exit(noauth());
require_once ZEAI.'cache/config_vip.php';
header("Cache-control: private");
if ($submitok == "us_update") {
	if(str_len($content)>40000 || str_len($content)<2){alert_adm("内容不能为空且不超过20000个字节，1个汉字等于2个字节！","-1");}
	$db->query("UPDATE ".__TBL_NEWS__." SET content='".dataIO($content,'in',40000)."' WHERE id=2");
	AddLog('【内容管理】->【网站简介】修改');
	alert_adm("修改成功","about.php?t=us");
}elseif($submitok == "declara_update"){
	if(str_len($content)>40000 || str_len($content)<2){alert_adm("内容不能为空且不超过20000个字节，1个汉字等于2个字节！","-1");}
	$db->query("UPDATE ".__TBL_NEWS__." SET content='".dataIO($content,'in',40000)."' WHERE id=1");
	AddLog('【内容管理】->【隐私条款】修改');
	alert_adm("修改成功","about.php?t=declara");
}?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!-- editor -->
<link rel="stylesheet" href="editor/themes/default/default.css" />
<script charset="utf-8" src="editor/kindeditor.js"></script>
<script charset="utf-8" src="editor/lang/zh_CN.js"></script>
<script>
var editor;
KindEditor.ready(function(K){
  editor=K.create('textarea[name="content"]',{
	resizeType : 1,
	cssData:'body {font-family: "微软雅黑"; font-size: 14px}',
	minWidth : 400,
	allowPreviewEmoticons : true,
	allowImageUpload : true,
	afterBlur:function(){this.sync();},
	items : [
		'undo','redo','fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline','removeformat', '|', 'insertorderedlist','insertunorderedlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull','lineheight','|',
		'selectall','quickformat', '|','image','multiimage','media', '|','plainpaste','wordpaste','hr','table', 'link', 'unlink','baidumap', '|','clearhtml','source', '|','preview','fullscreen']
  });
});
</script>
<!--editor end -->
<script src="<?php echo HOST;?>/res/www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="css/main.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css">
</head>
<body>
<div class="box">
        <div class="boxL">
            <a href="<?php echo SELF;?>?t=us"<?php echo ($t == 'us' || empty($t))?' class="ed"':'';?>>网站简介</a>
            <a href="<?php echo SELF;?>?t=contact"<?php echo ($t == 'contact')?' class="ed"':'';?>>联系我们</a>
            <a href="<?php echo SELF;?>?t=declara"<?php echo ($t == 'declara')?' class="ed"':'';?>>隐私条款</a>
            <a href="<?php echo SELF;?>?t=safetips"<?php echo ($t == 'safetips')?' class="ed"':'';?>>安全提醒</a>
        </div>
        <div class="boxR">
        
			<?php if ($t == "us") {
                $row = $db->ROW(__TBL_NEWS__,"content","id=2","num");if ($row){$C=dataIO($row[0],'wx');}else{callmsg("zeai_id_error","-1");}?>
                <form name="GYLform" id="GYLform" action="<?php echo SELF; ?>" method="post">
                <table class="table W98_">
                <tr>
                  <td height="50" align="center" class="S18 B">网站简介</td>
                </tr>
                <tr><td align="center"><textarea name="content" id="content" class="textarea_k" style="width:100%;height:400px"><?php echo $C; ?></textarea></td></tr>
                <tr><td height="50" align="center">
                <input class="btn size3" type="submit" value="确定并保存"/>
                <input name="submitok" type="hidden" value="us_update" /></td>
                </tr>
                </table>
				</form>
            <?php }elseif($t == "contact") {?>
            	<form name="ZEAIFORM" id="ZEAIFORM" method="post" enctype="multipart/form-data">
                <table class="table W98_ size2">
                <tr><td height="50" colspan="2" align="center" class="S18 B">联系我们</td>
                  </tr>
                
                <tr><td class="tdL">手机</td>
                  <td class="tdR">
                    <input name="kf_mob" type="text" class="input" id="kf_mob" value="<?php echo dataIO($_ZEAI['kf_mob'],'out');?>"size="50" maxlength="100"><span class="tips S12">网站总客服手机号</span>
                  </td>
                </tr>
                <tr><td class="tdL">电话</td>
                  <td class="tdR">
                    <input name="kf_tel" type="text" class="input" id="kf_tel" value="<?php echo dataIO($_ZEAI['kf_tel'],'out');?>"size="50" maxlength="100"><span class="tips S12">网站总客服电话(座机)</span>
                  </td>
                </tr>
                <tr><td class="tdL">微信号</td><td class="tdR"><input name="kf_wx" id="kf_wx" type="text" class="input" value="<?php echo dataIO($_ZEAI['kf_wx'],'out');?>" size="50" maxlength="100" ><span class="tips S12">网站总客服微信号</span></td></tr>
                <tr>
                  <td class="tdL">底部二维码</td><td class="tdR">
                        <?php if (!empty($_ZEAI['kf_wxpic'])) {?>
                            <input name='logo_' type='hidden' value="<?php echo $_ZEAI['kf_wxpic'];?>" />
                            <a class="pic60" onClick="parent.piczoom('<?php echo $_ZEAI['up2'].'/'.$_ZEAI['kf_wxpic']; ?>')"><img src="<?php echo $_ZEAI['up2'].'/'.$_ZEAI['kf_wxpic']; ?>?"></a>　
                            <a href="javascript:;" id="kf_wxpicdel" class="btn size1">删除</a>
                            <span class="tips S12">先删除后更换，网站总客服微信二维码，将显示到网站最底部；并且在没有红娘二维码情况下，将调用此码</span>
                        <?php }else{echo "<input name='kf_wxpic' type='file' size='50' class='input size2' style='width:374px' /><br><span class='tips2'>必须.png/.gif/.png格式，最佳尺寸：300×300像数以内正方形</span>";}?>	
                        
                        <br><br>个人主页红娘二维码显示此码：
                        <input type="checkbox" name="homekefuewm" id="homekefuewm" class="switch" value="1"<?php echo ($_ZEAI['homekefuewm'] == 1)?' checked':'';?>><label for="homekefuewm" class="switch-label"><i></i><b>开启</b><b>关闭</b></label><br><span class="tips2">开启后，浏览公海资源的个人主页将强制显示此码，不随机显示红娘二维码，<font class="Cf00">推荐关闭</font>，关闭后将随调用红娘</span>
                  </td></tr>
                <tr>
                <td class="tdL">QQ</td>
                <td class="tdR">
                <input name="kf_qq" type="text" class="input" id="kf_qq" value="<?php echo dataIO($_ZEAI['kf_qq'],'out');?>" size="50" maxlength="100"><span class="tips S12">网站总客服QQ</span>
                </td>
                </tr>
                <tr>
                  <td class="tdL">邮箱</td>
                  <td class="tdR">
                    <input name="kf_email" type="text" class="input" id="kf_email" value="<?php echo dataIO($_ZEAI['kf_email'],'out');?>"size="50" maxlength="100"><span class="tips S12">网站总客服邮箱</span>
                  </td>
                </tr>    
                <tr>
                  <td class="tdL">地址</td>
                  <td class="tdR">
                    <input name="kf_address" type="text" class="input" id="kf_address" value="<?php echo dataIO($_ZEAI['kf_address'],'out');?>"size="50" maxlength="100"><span class="tips S12">网站总部办工地点</span>
                  </td>
                </tr>    
                <input name="uu" type="hidden" value="<?php echo $session_uid;?>">
                <input name="pp" type="hidden" value="<?php echo $session_pwd;?>">
                <tr>
                  <td height="50" colspan="2" align="center"><input class="btn size3" type="button" id="save" value="确定并保存"/>
                  <input name="submitok" type="hidden" value="contact_update" /></td>
                  </tr>
				</table>
          		</form>
          <script>
                save.onclick = function(){
                    //zeai.confirm('确认要修改么？此修改将触发缓存机制同步更新，立即生效！',function(){
                        zeai.ajax({"url":'<?php echo HOST;?>/sub/cache'+zeai.extname,"form":ZEAIFORM},function(e){
                            var rs=zeai.jsoneval(e);
                            zeai.msg(rs.msg);
                            if (rs.flag == 1){setTimeout(function(){location.reload(true);},1000);}
                        });
                   // });
                }
                var uu=<?php echo $_SESSION['admuid'];?>,pp='<?php echo $_SESSION['admpwd'];?>';
                if (!zeai.empty(o('kf_wxpicdel')))o('kf_wxpicdel').onclick = function(){delpic('kf_wxpic_delupdate');}
                function delpic(submitok){
                    zeai.confirm('确认要删除么？',function(){
                        zeai.ajax({"url":'<?php echo HOST;?>/sub/cache'+zeai.extname,"data":{"submitok":submitok,"uu":uu,"pp":pp}},function(e){var rs=zeai.jsoneval(e);
                            zeai.msg(0);
                            if (rs.flag == 1){location.reload(true);}else{zeai.alert(rs.msg);}
                        });
                    });
                }
                </script>
            <?php }elseif($t == "declara") {
                $row = $db->ROW(__TBL_NEWS__,"content","id=1","num");if ($row){$C=dataIO($row[0],'out');}else{callmsg("zeai_id_error","-1");}
                ?>
                <table class="table W98_">
                <tr>
                  <td height="50" align="center" class="S18 B">隐私条款</td>
                </tr>
                <form name="GYLform" id="GYLform" action="<?php echo SELF; ?>" method="post">
                <tr><td align="center"><textarea name="content" id="content" class="textarea_k" style="width:100%;height:400px"><?php echo $C; ?></textarea></td></tr>
                <tr><td height="50" align="center">
                <input class="btn size3" type="submit" value="确定并保存"/>
                <input name="submitok" type="hidden" value="declara_update" /></td>
                </tr>
                </form>
                </table>
                
            <?php }elseif($t == "safetips") {?>
                
                <form id="ZEAI_CN___FORM">
                <table class="table W98_ size2 cols2">
                <tr>
                  <td height="50" colspan="2" align="center" class="S18 B">安全提醒</td>
                </tr>
                <tr>
                <td class="tdL">提醒内容</td>
                <td class="tdR"><textarea name="safetips" id="safetips" placeholder="会出现在相关页面提醒" rows="10" class="W80_ S14"><?php echo dataIO($_VIP['safetips'],'wx');?></textarea><br><span class="tips2">将会在一些关键页面提醒用户，比如手机端VIP升级页面</span>
                </td>
                </tr>
                <tr>
                  <td height="50" colspan="2" align="center">
                    <input name="submitok" id="submitok" type="hidden" value="ajax_mod_vip_safetips">
                    <input name="uu" id="uu" type="hidden" value="<?php echo $session_uid;?>">
                    <input name="pp" id="pp" type="hidden" value="<?php echo $session_pwd;?>">
                    <button type="button" class="btn size3" onClick="safetipsFn();">确定并保存</button>
                  </td>
                  </tr>
                </table>
          </form>
          <script>
                function safetipsFn(){
                    zeai.ajax({url:'<?php echo HOST;?>/sub/cache'+zeai.extname,form:ZEAI_CN___FORM},function(e){var rs=zeai.jsoneval(e);
                        zeai.msg(0);zeai.msg(rs.msg);
                        if (rs.flag == 1){setTimeout(function(){location.reload(true);},1000);}
                    });
                }
                </script>
            <?php }?>

  </div>
        <div class="clear"></div>
</div>
</div>
<?php require_once 'bottomadm.php';?>